package com.henry.javastudy.c04;

import java.util.concurrent.CountDownLatch;

public class MyRunnable1 implements Runnable {
    private int result=0;
    private CountDownLatch countDownLatch;
    public MyRunnable1(CountDownLatch countDownLatch){
        this.countDownLatch=countDownLatch;
    }
    @Override
    public void run() {
        setResult(MyCanculate.sum());
        countDownLatch.countDown();
        System.out.println("run task in MyRunnable1");
    }
    public void setResult(Integer i){
        result=i;
    }
    public int getResult()
    {
        return result;
    }
}
